repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.saveState
def saveState(self, stateObj): """Utility methos to save plugin state stored in stateObj to persistent storage to permit access to previous state in subsequent plugin runs. Any object that can be pickled and unpickled can be used to store the plugin state. @p...
python
def saveState(self, stateObj): """Utility methos to save plugin state stored in stateObj to persistent storage to permit access to previous state in subsequent plugin runs. Any object that can be pickled and unpickled can be used to store the plugin state. @p...
[ "def", "saveState", "(", "self", ",", "stateObj", ")", ":", "try", ":", "fp", "=", "open", "(", "self", ".", "_stateFile", ",", "'w'", ")", "pickle", ".", "dump", "(", "stateObj", ",", "fp", ")", "except", ":", "raise", "IOError", "(", "\"Failure in ...
Utility methos to save plugin state stored in stateObj to persistent storage to permit access to previous state in subsequent plugin runs. Any object that can be pickled and unpickled can be used to store the plugin state. @param stateObj: Object that stores plugin st...
[ "Utility", "methos", "to", "save", "plugin", "state", "stored", "in", "stateObj", "to", "persistent", "storage", "to", "permit", "access", "to", "previous", "state", "in", "subsequent", "plugin", "runs", ".", "Any", "object", "that", "can", "be", "pickled", ...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L448-L464
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.restoreState
def restoreState(self): """Utility method to restore plugin state from persistent storage to permit access to previous plugin state. @return: Object that stores plugin state. """ if os.path.exists(self._stateFile): try: fp = open(sel...
python
def restoreState(self): """Utility method to restore plugin state from persistent storage to permit access to previous plugin state. @return: Object that stores plugin state. """ if os.path.exists(self._stateFile): try: fp = open(sel...
[ "def", "restoreState", "(", "self", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "_stateFile", ")", ":", "try", ":", "fp", "=", "open", "(", "self", ".", "_stateFile", ",", "'r'", ")", "stateObj", "=", "pickle", ".", "load", ...
Utility method to restore plugin state from persistent storage to permit access to previous plugin state. @return: Object that stores plugin state.
[ "Utility", "method", "to", "restore", "plugin", "state", "from", "persistent", "storage", "to", "permit", "access", "to", "previous", "plugin", "state", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L466-L481
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.appendGraph
def appendGraph(self, graph_name, graph): """Utility method to associate Graph Object to Plugin. This utility method is for use in constructor of child classes for associating a MuninGraph instances to the plugin. @param graph_name: Graph Name @param graph: ...
python
def appendGraph(self, graph_name, graph): """Utility method to associate Graph Object to Plugin. This utility method is for use in constructor of child classes for associating a MuninGraph instances to the plugin. @param graph_name: Graph Name @param graph: ...
[ "def", "appendGraph", "(", "self", ",", "graph_name", ",", "graph", ")", ":", "self", ".", "_graphDict", "[", "graph_name", "]", "=", "graph", "self", ".", "_graphNames", ".", "append", "(", "graph_name", ")", "if", "not", "self", ".", "isMultigraph", "a...
Utility method to associate Graph Object to Plugin. This utility method is for use in constructor of child classes for associating a MuninGraph instances to the plugin. @param graph_name: Graph Name @param graph: MuninGraph Instance
[ "Utility", "method", "to", "associate", "Graph", "Object", "to", "Plugin", ".", "This", "utility", "method", "is", "for", "use", "in", "constructor", "of", "child", "classes", "for", "associating", "a", "MuninGraph", "instances", "to", "the", "plugin", ".", ...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L483-L496
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.appendSubgraph
def appendSubgraph(self, parent_name, graph_name, graph): """Utility method to associate Subgraph Instance to Root Graph Instance. This utility method is for use in constructor of child classes for associating a MuninGraph Subgraph instance with a Root Graph instance. @param ...
python
def appendSubgraph(self, parent_name, graph_name, graph): """Utility method to associate Subgraph Instance to Root Graph Instance. This utility method is for use in constructor of child classes for associating a MuninGraph Subgraph instance with a Root Graph instance. @param ...
[ "def", "appendSubgraph", "(", "self", ",", "parent_name", ",", "graph_name", ",", "graph", ")", ":", "if", "not", "self", ".", "isMultigraph", ":", "raise", "AttributeError", "(", "\"Simple Munin Plugins cannot have subgraphs.\"", ")", "if", "self", ".", "_graphDi...
Utility method to associate Subgraph Instance to Root Graph Instance. This utility method is for use in constructor of child classes for associating a MuninGraph Subgraph instance with a Root Graph instance. @param parent_name: Root Graph Name @param graph_name: Subgraph Name...
[ "Utility", "method", "to", "associate", "Subgraph", "Instance", "to", "Root", "Graph", "Instance", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L498-L519
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.setGraphVal
def setGraphVal(self, graph_name, field_name, val): """Utility method to set Value for Field in Graph. The private method is for use in retrieveVals() method of child classes. @param graph_name: Graph Name @param field_name: Field Name. @param val: Value ...
python
def setGraphVal(self, graph_name, field_name, val): """Utility method to set Value for Field in Graph. The private method is for use in retrieveVals() method of child classes. @param graph_name: Graph Name @param field_name: Field Name. @param val: Value ...
[ "def", "setGraphVal", "(", "self", ",", "graph_name", ",", "field_name", ",", "val", ")", ":", "graph", "=", "self", ".", "_getGraph", "(", "graph_name", ",", "True", ")", "if", "graph", ".", "hasField", "(", "field_name", ")", ":", "graph", ".", "setV...
Utility method to set Value for Field in Graph. The private method is for use in retrieveVals() method of child classes. @param graph_name: Graph Name @param field_name: Field Name. @param val: Value for field.
[ "Utility", "method", "to", "set", "Value", "for", "Field", "in", "Graph", ".", "The", "private", "method", "is", "for", "use", "in", "retrieveVals", "()", "method", "of", "child", "classes", ".", "@param", "graph_name", ":", "Graph", "Name", "@param", "fie...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L521-L536
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.setSubgraphVal
def setSubgraphVal(self, parent_name, graph_name, field_name, val): """Set Value for Field in Subgraph. The private method is for use in retrieveVals() method of child classes. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_...
python
def setSubgraphVal(self, parent_name, graph_name, field_name, val): """Set Value for Field in Subgraph. The private method is for use in retrieveVals() method of child classes. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_...
[ "def", "setSubgraphVal", "(", "self", ",", "parent_name", ",", "graph_name", ",", "field_name", ",", "val", ")", ":", "subgraph", "=", "self", ".", "_getSubGraph", "(", "parent_name", ",", "graph_name", ",", "True", ")", "if", "subgraph", ".", "hasField", ...
Set Value for Field in Subgraph. The private method is for use in retrieveVals() method of child classes. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_name: Field Name. @param val: Value for field.
[ "Set", "Value", "for", "Field", "in", "Subgraph", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L538-L556
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.getSubgraphList
def getSubgraphList(self, parent_name): """Returns list of names of subgraphs for Root Graph with name parent_name. @param parent_name: Name of Root Graph. @return: List of subgraph names. """ if not self.isMultigraph: raise AttributeError...
python
def getSubgraphList(self, parent_name): """Returns list of names of subgraphs for Root Graph with name parent_name. @param parent_name: Name of Root Graph. @return: List of subgraph names. """ if not self.isMultigraph: raise AttributeError...
[ "def", "getSubgraphList", "(", "self", ",", "parent_name", ")", ":", "if", "not", "self", ".", "isMultigraph", ":", "raise", "AttributeError", "(", "\"Simple Munin Plugins cannot have subgraphs.\"", ")", "if", "self", ".", "_graphDict", ".", "has_key", "(", "paren...
Returns list of names of subgraphs for Root Graph with name parent_name. @param parent_name: Name of Root Graph. @return: List of subgraph names.
[ "Returns", "list", "of", "names", "of", "subgraphs", "for", "Root", "Graph", "with", "name", "parent_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L594-L607
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.graphHasField
def graphHasField(self, graph_name, field_name): """Return true if graph with name graph_name has field with name field_name. @param graph_name: Graph Name @param field_name: Field Name. @return: Boolean """ graph = self._graphDict.get(graph_nam...
python
def graphHasField(self, graph_name, field_name): """Return true if graph with name graph_name has field with name field_name. @param graph_name: Graph Name @param field_name: Field Name. @return: Boolean """ graph = self._graphDict.get(graph_nam...
[ "def", "graphHasField", "(", "self", ",", "graph_name", ",", "field_name", ")", ":", "graph", "=", "self", ".", "_graphDict", ".", "get", "(", "graph_name", ",", "True", ")", "return", "graph", ".", "hasField", "(", "field_name", ")" ]
Return true if graph with name graph_name has field with name field_name. @param graph_name: Graph Name @param field_name: Field Name. @return: Boolean
[ "Return", "true", "if", "graph", "with", "name", "graph_name", "has", "field", "with", "name", "field_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L618-L628
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.subGraphHasField
def subGraphHasField(self, parent_name, graph_name, field_name): """Return true if subgraph with name graph_name with parent graph with name parent_name has field with name field_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_nam...
python
def subGraphHasField(self, parent_name, graph_name, field_name): """Return true if subgraph with name graph_name with parent graph with name parent_name has field with name field_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_nam...
[ "def", "subGraphHasField", "(", "self", ",", "parent_name", ",", "graph_name", ",", "field_name", ")", ":", "subgraph", "=", "self", ".", "_getSubGraph", "(", "parent_name", ",", "graph_name", ",", "True", ")", "return", "subgraph", ".", "hasField", "(", "fi...
Return true if subgraph with name graph_name with parent graph with name parent_name has field with name field_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @param field_name: Field Name. @return: Boolean
[ "Return", "true", "if", "subgraph", "with", "name", "graph_name", "with", "parent", "graph", "with", "name", "parent_name", "has", "field", "with", "name", "field_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L630-L641
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.getGraphFieldList
def getGraphFieldList(self, graph_name): """Returns list of names of fields for graph with name graph_name. @param graph_name: Graph Name @return: List of field names for graph. """ graph = self._getGraph(graph_name, True) return graph.getField...
python
def getGraphFieldList(self, graph_name): """Returns list of names of fields for graph with name graph_name. @param graph_name: Graph Name @return: List of field names for graph. """ graph = self._getGraph(graph_name, True) return graph.getField...
[ "def", "getGraphFieldList", "(", "self", ",", "graph_name", ")", ":", "graph", "=", "self", ".", "_getGraph", "(", "graph_name", ",", "True", ")", "return", "graph", ".", "getFieldList", "(", ")" ]
Returns list of names of fields for graph with name graph_name. @param graph_name: Graph Name @return: List of field names for graph.
[ "Returns", "list", "of", "names", "of", "fields", "for", "graph", "with", "name", "graph_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L643-L651
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.getGraphFieldCount
def getGraphFieldCount(self, graph_name): """Returns number of fields for graph with name graph_name. @param graph_name: Graph Name @return: Number of fields for graph. """ graph = self._getGraph(graph_name, True) return graph.getFieldCount()
python
def getGraphFieldCount(self, graph_name): """Returns number of fields for graph with name graph_name. @param graph_name: Graph Name @return: Number of fields for graph. """ graph = self._getGraph(graph_name, True) return graph.getFieldCount()
[ "def", "getGraphFieldCount", "(", "self", ",", "graph_name", ")", ":", "graph", "=", "self", ".", "_getGraph", "(", "graph_name", ",", "True", ")", "return", "graph", ".", "getFieldCount", "(", ")" ]
Returns number of fields for graph with name graph_name. @param graph_name: Graph Name @return: Number of fields for graph.
[ "Returns", "number", "of", "fields", "for", "graph", "with", "name", "graph_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L653-L661
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.getSubgraphFieldList
def getSubgraphFieldList(self, parent_name, graph_name): """Returns list of names of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: List of field n...
python
def getSubgraphFieldList(self, parent_name, graph_name): """Returns list of names of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: List of field n...
[ "def", "getSubgraphFieldList", "(", "self", ",", "parent_name", ",", "graph_name", ")", ":", "graph", "=", "self", ".", "_getSubGraph", "(", "parent_name", ",", "graph_name", ",", "True", ")", "return", "graph", ".", "getFieldList", "(", ")" ]
Returns list of names of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: List of field names for subgraph.
[ "Returns", "list", "of", "names", "of", "fields", "for", "subgraph", "with", "name", "graph_name", "and", "parent", "graph", "with", "name", "parent_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L663-L673
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.getSubgraphFieldCount
def getSubgraphFieldCount(self, parent_name, graph_name): """Returns number of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: Number of fields for...
python
def getSubgraphFieldCount(self, parent_name, graph_name): """Returns number of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: Number of fields for...
[ "def", "getSubgraphFieldCount", "(", "self", ",", "parent_name", ",", "graph_name", ")", ":", "graph", "=", "self", ".", "_getSubGraph", "(", "parent_name", ",", "graph_name", ",", "True", ")", "return", "graph", ".", "getFieldCount", "(", ")" ]
Returns number of fields for subgraph with name graph_name and parent graph with name parent_name. @param parent_name: Root Graph Name @param graph_name: Subgraph Name @return: Number of fields for subgraph.
[ "Returns", "number", "of", "fields", "for", "subgraph", "with", "name", "graph_name", "and", "parent", "graph", "with", "name", "parent_name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L675-L685
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.config
def config(self): """Implements Munin Plugin Graph Configuration. Prints out configuration for graphs. Use as is. Not required to be overwritten in child classes. The plugin will work correctly as long as the Munin Graph objects have been populated. """ ...
python
def config(self): """Implements Munin Plugin Graph Configuration. Prints out configuration for graphs. Use as is. Not required to be overwritten in child classes. The plugin will work correctly as long as the Munin Graph objects have been populated. """ ...
[ "def", "config", "(", "self", ")", ":", "for", "parent_name", "in", "self", ".", "_graphNames", ":", "graph", "=", "self", ".", "_graphDict", "[", "parent_name", "]", "if", "self", ".", "isMultigraph", ":", "print", "\"multigraph %s\"", "%", "self", ".", ...
Implements Munin Plugin Graph Configuration. Prints out configuration for graphs. Use as is. Not required to be overwritten in child classes. The plugin will work correctly as long as the Munin Graph objects have been populated.
[ "Implements", "Munin", "Plugin", "Graph", "Configuration", ".", "Prints", "out", "configuration", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L708-L733
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.fetch
def fetch(self): """Implements Munin Plugin Fetch Option. Prints out measured values. """ self.retrieveVals() for parent_name in self._graphNames: graph = self._graphDict[parent_name] if self.isMultigraph: print "multigraph %s" % self._ge...
python
def fetch(self): """Implements Munin Plugin Fetch Option. Prints out measured values. """ self.retrieveVals() for parent_name in self._graphNames: graph = self._graphDict[parent_name] if self.isMultigraph: print "multigraph %s" % self._ge...
[ "def", "fetch", "(", "self", ")", ":", "self", ".", "retrieveVals", "(", ")", "for", "parent_name", "in", "self", ".", "_graphNames", ":", "graph", "=", "self", ".", "_graphDict", "[", "parent_name", "]", "if", "self", ".", "isMultigraph", ":", "print", ...
Implements Munin Plugin Fetch Option. Prints out measured values.
[ "Implements", "Munin", "Plugin", "Fetch", "Option", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L744-L766
aouyar/PyMunin
pymunin/__init__.py
MuninPlugin.run
def run(self): """Implements main entry point for plugin execution.""" if len(self._argv) > 1 and len(self._argv[1]) > 0: oper = self._argv[1] else: oper = 'fetch' if oper == 'fetch': ret = self.fetch() elif oper == 'config': ret = ...
python
def run(self): """Implements main entry point for plugin execution.""" if len(self._argv) > 1 and len(self._argv[1]) > 0: oper = self._argv[1] else: oper = 'fetch' if oper == 'fetch': ret = self.fetch() elif oper == 'config': ret = ...
[ "def", "run", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_argv", ")", ">", "1", "and", "len", "(", "self", ".", "_argv", "[", "1", "]", ")", ">", "0", ":", "oper", "=", "self", ".", "_argv", "[", "1", "]", "else", ":", "oper", ...
Implements main entry point for plugin execution.
[ "Implements", "main", "entry", "point", "for", "plugin", "execution", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L768-L791
aouyar/PyMunin
pymunin/__init__.py
MuninGraph.addField
def addField(self, name, label, type=None, draw=None, info=None, #@ReservedAssignment extinfo=None, colour=None, negative=None, graph=None, min=None, max=None, cdef=None, line=None, #@ReservedAssignment warning=None, critical=None): """Add field to Munin Grap...
python
def addField(self, name, label, type=None, draw=None, info=None, #@ReservedAssignment extinfo=None, colour=None, negative=None, graph=None, min=None, max=None, cdef=None, line=None, #@ReservedAssignment warning=None, critical=None): """Add field to Munin Grap...
[ "def", "addField", "(", "self", ",", "name", ",", "label", ",", "type", "=", "None", ",", "draw", "=", "None", ",", "info", "=", "None", ",", "#@ReservedAssignment", "extinfo", "=", "None", ",", "colour", "=", "None", ",", "negative", "=", "None", ",...
Add field to Munin Graph @param name: Field Name @param label: Field Label @param type: Stat Type: 'COUNTER' / 'ABSOLUTE' / 'DERIVE' / 'GAUGE' @param draw: Graph Type: 'AREA' / 'LINE{1,2,3}'...
[ "Add", "field", "to", "Munin", "Graph" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L836-L869
aouyar/PyMunin
pymunin/__init__.py
MuninGraph.hasField
def hasField(self, name): """Returns true if field with field_name exists. @param name: Field Name @return: Boolean """ if self._autoFixNames: name = self._fixName(name) return self._fieldAttrDict.has_key(name)
python
def hasField(self, name): """Returns true if field with field_name exists. @param name: Field Name @return: Boolean """ if self._autoFixNames: name = self._fixName(name) return self._fieldAttrDict.has_key(name)
[ "def", "hasField", "(", "self", ",", "name", ")", ":", "if", "self", ".", "_autoFixNames", ":", "name", "=", "self", ".", "_fixName", "(", "name", ")", "return", "self", ".", "_fieldAttrDict", ".", "has_key", "(", "name", ")" ]
Returns true if field with field_name exists. @param name: Field Name @return: Boolean
[ "Returns", "true", "if", "field", "with", "field_name", "exists", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L871-L880
aouyar/PyMunin
pymunin/__init__.py
MuninGraph.getConfig
def getConfig(self): """Returns dictionary of config entries for Munin Graph. @return: Dictionary of config entries. """ return {'graph': self._graphAttrDict, 'fields': [(field_name, self._fieldAttrDict.get(field_name)) for fi...
python
def getConfig(self): """Returns dictionary of config entries for Munin Graph. @return: Dictionary of config entries. """ return {'graph': self._graphAttrDict, 'fields': [(field_name, self._fieldAttrDict.get(field_name)) for fi...
[ "def", "getConfig", "(", "self", ")", ":", "return", "{", "'graph'", ":", "self", ".", "_graphAttrDict", ",", "'fields'", ":", "[", "(", "field_name", ",", "self", ".", "_fieldAttrDict", ".", "get", "(", "field_name", ")", ")", "for", "field_name", "in",...
Returns dictionary of config entries for Munin Graph. @return: Dictionary of config entries.
[ "Returns", "dictionary", "of", "config", "entries", "for", "Munin", "Graph", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L898-L906
aouyar/PyMunin
pymunin/__init__.py
MuninGraph.setVal
def setVal(self, name, val): """Set value for field in graph. @param name : Graph Name @param value : Value for field. """ if self._autoFixNames: name = self._fixName(name) self._fieldValDict[name] = val
python
def setVal(self, name, val): """Set value for field in graph. @param name : Graph Name @param value : Value for field. """ if self._autoFixNames: name = self._fixName(name) self._fieldValDict[name] = val
[ "def", "setVal", "(", "self", ",", "name", ",", "val", ")", ":", "if", "self", ".", "_autoFixNames", ":", "name", "=", "self", ".", "_fixName", "(", "name", ")", "self", ".", "_fieldValDict", "[", "name", "]", "=", "val" ]
Set value for field in graph. @param name : Graph Name @param value : Value for field.
[ "Set", "value", "for", "field", "in", "graph", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L908-L917
aouyar/PyMunin
pymunin/__init__.py
MuninGraph.getVals
def getVals(self): """Returns value list for Munin Graph @return: List of name-value pairs. """ return [(name, self._fieldValDict.get(name)) for name in self._fieldNameList]
python
def getVals(self): """Returns value list for Munin Graph @return: List of name-value pairs. """ return [(name, self._fieldValDict.get(name)) for name in self._fieldNameList]
[ "def", "getVals", "(", "self", ")", ":", "return", "[", "(", "name", ",", "self", ".", "_fieldValDict", ".", "get", "(", "name", ")", ")", "for", "name", "in", "self", ".", "_fieldNameList", "]" ]
Returns value list for Munin Graph @return: List of name-value pairs.
[ "Returns", "value", "list", "for", "Munin", "Graph" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/__init__.py#L919-L926
aouyar/PyMunin
pysysinfo/phpapc.py
APCinfo.initStats
def initStats(self, extras=None): """Query and parse Web Server Status Page. @param extras: Include extra metrics, which can be computationally more expensive. """ if extras is not None: self._extras = extras if self._extras: ...
python
def initStats(self, extras=None): """Query and parse Web Server Status Page. @param extras: Include extra metrics, which can be computationally more expensive. """ if extras is not None: self._extras = extras if self._extras: ...
[ "def", "initStats", "(", "self", ",", "extras", "=", "None", ")", ":", "if", "extras", "is", "not", "None", ":", "self", ".", "_extras", "=", "extras", "if", "self", ".", "_extras", ":", "detail", "=", "1", "else", ":", "detail", "=", "0", "url", ...
Query and parse Web Server Status Page. @param extras: Include extra metrics, which can be computationally more expensive.
[ "Query", "and", "parse", "Web", "Server", "Status", "Page", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/phpapc.py#L71-L92
aouyar/PyMunin
pysysinfo/nginx.py
NginxInfo.initStats
def initStats(self): """Query and parse Nginx Web Server Status Page.""" url = "%s://%s:%d/%s" % (self._proto, self._host, self._port, self._statuspath) response = util.get_url(url, self._user, self._password) self._statusDict = {} for line in re...
python
def initStats(self): """Query and parse Nginx Web Server Status Page.""" url = "%s://%s:%d/%s" % (self._proto, self._host, self._port, self._statuspath) response = util.get_url(url, self._user, self._password) self._statusDict = {} for line in re...
[ "def", "initStats", "(", "self", ")", ":", "url", "=", "\"%s://%s:%d/%s\"", "%", "(", "self", ".", "_proto", ",", "self", ".", "_host", ",", "self", ".", "_port", ",", "self", ".", "_statuspath", ")", "response", "=", "util", ".", "get_url", "(", "ur...
Query and parse Nginx Web Server Status Page.
[ "Query", "and", "parse", "Nginx", "Web", "Server", "Status", "Page", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/nginx.py#L68-L83
aouyar/PyMunin
setup.py
read_file
def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return ''
python
def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return ''
[ "def", "read_file", "(", "filename", ")", ":", "path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", "filepath", "=", "os", ".", "path", ".", "join", "(", "path", ",", "filename", ")", ...
Read a file into a string
[ "Read", "a", "file", "into", "a", "string" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/setup.py#L16-L23
aouyar/PyMunin
pymunin/plugins/procstats.py
MuninProcStatsPlugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" proc_info = ProcessInfo() stats = {} for (prefix, is_thread) in (('proc', False), ('thread', True)): graph_name = '%s_status' % prefix if self.hasGraph(graph_name): ...
python
def retrieveVals(self): """Retrieve values for graphs.""" proc_info = ProcessInfo() stats = {} for (prefix, is_thread) in (('proc', False), ('thread', True)): graph_name = '%s_status' % prefix if self.hasGraph(graph_name): ...
[ "def", "retrieveVals", "(", "self", ")", ":", "proc_info", "=", "ProcessInfo", "(", ")", "stats", "=", "{", "}", "for", "(", "prefix", ",", "is_thread", ")", "in", "(", "(", "'proc'", ",", "False", ")", ",", "(", "'thread'", ",", "True", ")", ")", ...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/procstats.py#L105-L133
aouyar/PyMunin
pymunin/plugins/rackspacestats.py
MuninRackspacePlugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" file_stats = self._fileInfo.getContainerStats() for contname in self._fileContList: stats = file_stats.get(contname) if stats is not None: if self.hasGraph('rackspace_cloudfiles_container_size'): ...
python
def retrieveVals(self): """Retrieve values for graphs.""" file_stats = self._fileInfo.getContainerStats() for contname in self._fileContList: stats = file_stats.get(contname) if stats is not None: if self.hasGraph('rackspace_cloudfiles_container_size'): ...
[ "def", "retrieveVals", "(", "self", ")", ":", "file_stats", "=", "self", ".", "_fileInfo", ".", "getContainerStats", "(", ")", "for", "contname", "in", "self", ".", "_fileContList", ":", "stats", "=", "file_stats", ".", "get", "(", "contname", ")", "if", ...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/rackspacestats.py#L125-L136
ContextLab/quail
quail/plot.py
plot
def plot(results, subjgroup=None, subjname='Subject Group', listgroup=None, listname='List', subjconds=None, listconds=None, plot_type=None, plot_style=None, title=None, legend=True, xlim=None, ylim=None, save_path=None, show=True, ax=None, **kwargs): """ General plot function that gr...
python
def plot(results, subjgroup=None, subjname='Subject Group', listgroup=None, listname='List', subjconds=None, listconds=None, plot_type=None, plot_style=None, title=None, legend=True, xlim=None, ylim=None, save_path=None, show=True, ax=None, **kwargs): """ General plot function that gr...
[ "def", "plot", "(", "results", ",", "subjgroup", "=", "None", ",", "subjname", "=", "'Subject Group'", ",", "listgroup", "=", "None", ",", "listname", "=", "'List'", ",", "subjconds", "=", "None", ",", "listconds", "=", "None", ",", "plot_type", "=", "No...
General plot function that groups data by subject/list number and performs analysis. Parameters ---------- results : quail.FriedEgg Object containing results subjgroup : list of strings or ints String/int variables indicating how to group over subjects. Must be the length of t...
[ "General", "plot", "function", "that", "groups", "data", "by", "subject", "/", "list", "number", "and", "performs", "analysis", "." ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/plot.py#L12-L288
aouyar/PyMunin
pysysinfo/netiface.py
NetIfaceInfo.getIfStats
def getIfStats(self): """Return dictionary of Traffic Stats for Network Interfaces. @return: Nested dictionary of statistics for each interface. """ info_dict = {} try: fp = open(ifaceStatsFile, 'r') data = fp.read() fp.close(...
python
def getIfStats(self): """Return dictionary of Traffic Stats for Network Interfaces. @return: Nested dictionary of statistics for each interface. """ info_dict = {} try: fp = open(ifaceStatsFile, 'r') data = fp.read() fp.close(...
[ "def", "getIfStats", "(", "self", ")", ":", "info_dict", "=", "{", "}", "try", ":", "fp", "=", "open", "(", "ifaceStatsFile", ",", "'r'", ")", "data", "=", "fp", ".", "read", "(", ")", "fp", ".", "close", "(", ")", "except", ":", "raise", "IOErro...
Return dictionary of Traffic Stats for Network Interfaces. @return: Nested dictionary of statistics for each interface.
[ "Return", "dictionary", "of", "Traffic", "Stats", "for", "Network", "Interfaces", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netiface.py#L27-L53
aouyar/PyMunin
pysysinfo/netiface.py
NetIfaceInfo.getIfConfig
def getIfConfig(self): """Return dictionary of Interface Configuration (ifconfig). @return: Dictionary of if configurations keyed by if name. """ conf = {} try: out = subprocess.Popen([ipCmd, "addr", "show"], stdou...
python
def getIfConfig(self): """Return dictionary of Interface Configuration (ifconfig). @return: Dictionary of if configurations keyed by if name. """ conf = {} try: out = subprocess.Popen([ipCmd, "addr", "show"], stdou...
[ "def", "getIfConfig", "(", "self", ")", ":", "conf", "=", "{", "}", "try", ":", "out", "=", "subprocess", ".", "Popen", "(", "[", "ipCmd", ",", "\"addr\"", ",", "\"show\"", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", ".", "communicate", ...
Return dictionary of Interface Configuration (ifconfig). @return: Dictionary of if configurations keyed by if name.
[ "Return", "dictionary", "of", "Interface", "Configuration", "(", "ifconfig", ")", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netiface.py#L55-L94
aouyar/PyMunin
pysysinfo/netiface.py
NetIfaceInfo.getRoutes
def getRoutes(self): """Get routing table. @return: List of routes. """ routes = [] try: out = subprocess.Popen([routeCmd, "-n"], stdout=subprocess.PIPE).communicate()[0] except: raise Exception...
python
def getRoutes(self): """Get routing table. @return: List of routes. """ routes = [] try: out = subprocess.Popen([routeCmd, "-n"], stdout=subprocess.PIPE).communicate()[0] except: raise Exception...
[ "def", "getRoutes", "(", "self", ")", ":", "routes", "=", "[", "]", "try", ":", "out", "=", "subprocess", ".", "Popen", "(", "[", "routeCmd", ",", "\"-n\"", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", ".", "communicate", "(", ")", "[",...
Get routing table. @return: List of routes.
[ "Get", "routing", "table", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netiface.py#L96-L113
aouyar/PyMunin
pysysinfo/netstat.py
NetstatInfo.execNetstatCmd
def execNetstatCmd(self, *args): """Execute ps command with positional params args and return result as list of lines. @param *args: Positional params for netstat command. @return: List of output lines """ out = util.exec_command([netstatCmd,] + li...
python
def execNetstatCmd(self, *args): """Execute ps command with positional params args and return result as list of lines. @param *args: Positional params for netstat command. @return: List of output lines """ out = util.exec_command([netstatCmd,] + li...
[ "def", "execNetstatCmd", "(", "self", ",", "*", "args", ")", ":", "out", "=", "util", ".", "exec_command", "(", "[", "netstatCmd", ",", "]", "+", "list", "(", "args", ")", ")", "return", "out", ".", "splitlines", "(", ")" ]
Execute ps command with positional params args and return result as list of lines. @param *args: Positional params for netstat command. @return: List of output lines
[ "Execute", "ps", "command", "with", "positional", "params", "args", "and", "return", "result", "as", "list", "of", "lines", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netstat.py#L30-L39
aouyar/PyMunin
pysysinfo/netstat.py
NetstatInfo.parseNetstatCmd
def parseNetstatCmd(self, tcp=True, udp=True, ipv4=True, ipv6=True, include_listen=True, only_listen=False, show_users=False, show_procs=False, resolve_hosts=False, resolve_ports=False, resolve_users=True): """Exec...
python
def parseNetstatCmd(self, tcp=True, udp=True, ipv4=True, ipv6=True, include_listen=True, only_listen=False, show_users=False, show_procs=False, resolve_hosts=False, resolve_ports=False, resolve_users=True): """Exec...
[ "def", "parseNetstatCmd", "(", "self", ",", "tcp", "=", "True", ",", "udp", "=", "True", ",", "ipv4", "=", "True", ",", "ipv6", "=", "True", ",", "include_listen", "=", "True", ",", "only_listen", "=", "False", ",", "show_users", "=", "False", ",", "...
Execute netstat command and return result as a nested dictionary. @param tcp: Include TCP ports in ouput if True. @param udp: Include UDP ports in ouput if True. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv...
[ "Execute", "netstat", "command", "and", "return", "result", "as", "a", "nested", "dictionary", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netstat.py#L41-L117
aouyar/PyMunin
pysysinfo/netstat.py
NetstatInfo.getStats
def getStats(self, tcp=True, udp=True, ipv4=True, ipv6=True, include_listen=True, only_listen=False, show_users=False, show_procs=False, resolve_hosts=False, resolve_ports=False, resolve_users=True, **kwargs): """Execute netstat command and ...
python
def getStats(self, tcp=True, udp=True, ipv4=True, ipv6=True, include_listen=True, only_listen=False, show_users=False, show_procs=False, resolve_hosts=False, resolve_ports=False, resolve_users=True, **kwargs): """Execute netstat command and ...
[ "def", "getStats", "(", "self", ",", "tcp", "=", "True", ",", "udp", "=", "True", ",", "ipv4", "=", "True", ",", "ipv6", "=", "True", ",", "include_listen", "=", "True", ",", "only_listen", "=", "False", ",", "show_users", "=", "False", ",", "show_pr...
Execute netstat command and return result as a nested dictionary. @param tcp: Include TCP ports in ouput if True. @param udp: Include UDP ports in ouput if True. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv...
[ "Execute", "netstat", "command", "and", "return", "result", "as", "a", "nested", "dictionary", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netstat.py#L119-L170
aouyar/PyMunin
pysysinfo/netstat.py
NetstatInfo.getTCPportConnStatus
def getTCPportConnStatus(self, ipv4=True, ipv6=True, include_listen=False, **kwargs): """Returns the number of TCP endpoints discriminated by status. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in ou...
python
def getTCPportConnStatus(self, ipv4=True, ipv6=True, include_listen=False, **kwargs): """Returns the number of TCP endpoints discriminated by status. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in ou...
[ "def", "getTCPportConnStatus", "(", "self", ",", "ipv4", "=", "True", ",", "ipv6", "=", "True", ",", "include_listen", "=", "False", ",", "*", "*", "kwargs", ")", ":", "status_dict", "=", "{", "}", "result", "=", "self", ".", "getStats", "(", "tcp", ...
Returns the number of TCP endpoints discriminated by status. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in output if True. @param include_listen: Include listening ports in output if True. @param **kwargs: Keyword...
[ "Returns", "the", "number", "of", "TCP", "endpoints", "discriminated", "by", "status", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netstat.py#L172-L209
aouyar/PyMunin
pysysinfo/netstat.py
NetstatInfo.getTCPportConnCount
def getTCPportConnCount(self, ipv4=True, ipv6=True, resolve_ports=False, **kwargs): """Returns TCP connection counts for each local port. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in output if True. ...
python
def getTCPportConnCount(self, ipv4=True, ipv6=True, resolve_ports=False, **kwargs): """Returns TCP connection counts for each local port. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in output if True. ...
[ "def", "getTCPportConnCount", "(", "self", ",", "ipv4", "=", "True", ",", "ipv6", "=", "True", ",", "resolve_ports", "=", "False", ",", "*", "*", "kwargs", ")", ":", "port_dict", "=", "{", "}", "result", "=", "self", ".", "getStats", "(", "tcp", "=",...
Returns TCP connection counts for each local port. @param ipv4: Include IPv4 ports in output if True. @param ipv6: Include IPv6 ports in output if True. @param resolve_ports: Resolve numeric ports to names if True. @param **kwargs: Keyword variables are us...
[ "Returns", "TCP", "connection", "counts", "for", "each", "local", "port", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/netstat.py#L211-L247
ContextLab/quail
quail/analysis/accuracy.py
accuracy_helper
def accuracy_helper(egg, match='exact', distance='euclidean', features=None): """ Computes proportion of words recalled Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recall matrix. If ...
python
def accuracy_helper(egg, match='exact', distance='euclidean', features=None): """ Computes proportion of words recalled Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recall matrix. If ...
[ "def", "accuracy_helper", "(", "egg", ",", "match", "=", "'exact'", ",", "distance", "=", "'euclidean'", ",", "features", "=", "None", ")", ":", "def", "acc", "(", "lst", ")", ":", "return", "len", "(", "[", "i", "for", "i", "in", "np", ".", "uniqu...
Computes proportion of words recalled Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recall matrix. If exact, the presented and recalled items must be identical (default). If best, the recalled item ...
[ "Computes", "proportion", "of", "words", "recalled" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/accuracy.py#L5-L50
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo._connect
def _connect(self): """Establish connection to PostgreSQL Database.""" if self._connParams: self._conn = psycopg2.connect(**self._connParams) else: self._conn = psycopg2.connect('') try: ver_str = self._conn.get_parameter_status('server_version') ...
python
def _connect(self): """Establish connection to PostgreSQL Database.""" if self._connParams: self._conn = psycopg2.connect(**self._connParams) else: self._conn = psycopg2.connect('') try: ver_str = self._conn.get_parameter_status('server_version') ...
[ "def", "_connect", "(", "self", ")", ":", "if", "self", ".", "_connParams", ":", "self", ".", "_conn", "=", "psycopg2", ".", "connect", "(", "*", "*", "self", ".", "_connParams", ")", "else", ":", "self", ".", "_conn", "=", "psycopg2", ".", "connect"...
Establish connection to PostgreSQL Database.
[ "Establish", "connection", "to", "PostgreSQL", "Database", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L76-L86
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo._createStatsDict
def _createStatsDict(self, headers, rows): """Utility method that returns database stats as a nested dictionary. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Nested dictionary of values. Fi...
python
def _createStatsDict(self, headers, rows): """Utility method that returns database stats as a nested dictionary. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Nested dictionary of values. Fi...
[ "def", "_createStatsDict", "(", "self", ",", "headers", ",", "rows", ")", ":", "dbstats", "=", "{", "}", "for", "row", "in", "rows", ":", "dbstats", "[", "row", "[", "0", "]", "]", "=", "dict", "(", "zip", "(", "headers", "[", "1", ":", "]", ",...
Utility method that returns database stats as a nested dictionary. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Nested dictionary of values. First key is the database name and the second key is the...
[ "Utility", "method", "that", "returns", "database", "stats", "as", "a", "nested", "dictionary", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L88-L101
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo._createTotalsDict
def _createTotalsDict(self, headers, rows): """Utility method that returns totals for database statistics. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Dictionary of totals for each statistics column. ...
python
def _createTotalsDict(self, headers, rows): """Utility method that returns totals for database statistics. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Dictionary of totals for each statistics column. ...
[ "def", "_createTotalsDict", "(", "self", ",", "headers", ",", "rows", ")", ":", "totals", "=", "[", "sum", "(", "col", ")", "for", "col", "in", "zip", "(", "*", "rows", ")", "[", "1", ":", "]", "]", "return", "dict", "(", "zip", "(", "headers", ...
Utility method that returns totals for database statistics. @param headers: List of columns in query result. @param rows: List of rows in query result. @return: Dictionary of totals for each statistics column.
[ "Utility", "method", "that", "returns", "totals", "for", "database", "statistics", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L103-L112
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo._simpleQuery
def _simpleQuery(self, query): """Executes simple query which returns a single column. @param query: Query string. @return: Query result string. """ cur = self._conn.cursor() cur.execute(query) row = cur.fetchone() return util.parse_...
python
def _simpleQuery(self, query): """Executes simple query which returns a single column. @param query: Query string. @return: Query result string. """ cur = self._conn.cursor() cur.execute(query) row = cur.fetchone() return util.parse_...
[ "def", "_simpleQuery", "(", "self", ",", "query", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "query", ")", "row", "=", "cur", ".", "fetchone", "(", ")", "return", "util", ".", "parse_value", "("...
Executes simple query which returns a single column. @param query: Query string. @return: Query result string.
[ "Executes", "simple", "query", "which", "returns", "a", "single", "column", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L114-L124
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getParam
def getParam(self, key): """Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value. """ cur = self._conn.cursor() cur.execute("SHOW %s" % key) row = cur.fetchone() ret...
python
def getParam(self, key): """Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value. """ cur = self._conn.cursor() cur.execute("SHOW %s" % key) row = cur.fetchone() ret...
[ "def", "getParam", "(", "self", ",", "key", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"SHOW %s\"", "%", "key", ")", "row", "=", "cur", ".", "fetchone", "(", ")", "return", "util", ".", "par...
Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value.
[ "Returns", "value", "of", "Run", "-", "time", "Database", "Parameter", "key", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L151-L161
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getConnectionStats
def getConnectionStats(self): """Returns dictionary with number of connections for each database. @return: Dictionary of database connection statistics. """ cur = self._conn.cursor() cur.execute("""SELECT datname,numbackends FROM pg_stat_database;""") ro...
python
def getConnectionStats(self): """Returns dictionary with number of connections for each database. @return: Dictionary of database connection statistics. """ cur = self._conn.cursor() cur.execute("""SELECT datname,numbackends FROM pg_stat_database;""") ro...
[ "def", "getConnectionStats", "(", "self", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"SELECT datname,numbackends FROM pg_stat_database;\"\"\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")", "if"...
Returns dictionary with number of connections for each database. @return: Dictionary of database connection statistics.
[ "Returns", "dictionary", "with", "number", "of", "connections", "for", "each", "database", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L193-L205
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getDatabaseStats
def getDatabaseStats(self): """Returns database block read, transaction and tuple stats for each database. @return: Nested dictionary of stats. """ headers = ('datname', 'numbackends', 'xact_commit', 'xact_rollback', 'blks_read', 'blks_hit',...
python
def getDatabaseStats(self): """Returns database block read, transaction and tuple stats for each database. @return: Nested dictionary of stats. """ headers = ('datname', 'numbackends', 'xact_commit', 'xact_rollback', 'blks_read', 'blks_hit',...
[ "def", "getDatabaseStats", "(", "self", ")", ":", "headers", "=", "(", "'datname'", ",", "'numbackends'", ",", "'xact_commit'", ",", "'xact_rollback'", ",", "'blks_read'", ",", "'blks_hit'", ",", "'tup_returned'", ",", "'tup_fetched'", ",", "'tup_inserted'", ",", ...
Returns database block read, transaction and tuple stats for each database. @return: Nested dictionary of stats.
[ "Returns", "database", "block", "read", "transaction", "and", "tuple", "stats", "for", "each", "database", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L207-L223
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getLockStatsMode
def getLockStatsMode(self): """Returns the number of active lock discriminated by lock mode. @return: : Dictionary of stats. """ info_dict = {'all': dict(zip(self.lockModes, (0,) * len(self.lockModes))), 'wait': dict(zip(self.lockModes, (0,) * len(s...
python
def getLockStatsMode(self): """Returns the number of active lock discriminated by lock mode. @return: : Dictionary of stats. """ info_dict = {'all': dict(zip(self.lockModes, (0,) * len(self.lockModes))), 'wait': dict(zip(self.lockModes, (0,) * len(s...
[ "def", "getLockStatsMode", "(", "self", ")", ":", "info_dict", "=", "{", "'all'", ":", "dict", "(", "zip", "(", "self", ".", "lockModes", ",", "(", "0", ",", ")", "*", "len", "(", "self", ".", "lockModes", ")", ")", ")", ",", "'wait'", ":", "dict...
Returns the number of active lock discriminated by lock mode. @return: : Dictionary of stats.
[ "Returns", "the", "number", "of", "active", "lock", "discriminated", "by", "lock", "mode", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L225-L241
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getLockStatsDB
def getLockStatsDB(self): """Returns the number of active lock discriminated by database. @return: : Dictionary of stats. """ info_dict = {'all': {}, 'wait': {}} cur = self._conn.cursor() cur.execute("SELECT d.datname, l.granted, COU...
python
def getLockStatsDB(self): """Returns the number of active lock discriminated by database. @return: : Dictionary of stats. """ info_dict = {'all': {}, 'wait': {}} cur = self._conn.cursor() cur.execute("SELECT d.datname, l.granted, COU...
[ "def", "getLockStatsDB", "(", "self", ")", ":", "info_dict", "=", "{", "'all'", ":", "{", "}", ",", "'wait'", ":", "{", "}", "}", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"SELECT d.datname, l.granted, COU...
Returns the number of active lock discriminated by database. @return: : Dictionary of stats.
[ "Returns", "the", "number", "of", "active", "lock", "discriminated", "by", "database", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L243-L260
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getBgWriterStats
def getBgWriterStats(self): """Returns Global Background Writer and Checkpoint Activity stats. @return: Nested dictionary of stats. """ info_dict = {} if self.checkVersion('8.3'): cur = self._conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)...
python
def getBgWriterStats(self): """Returns Global Background Writer and Checkpoint Activity stats. @return: Nested dictionary of stats. """ info_dict = {} if self.checkVersion('8.3'): cur = self._conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)...
[ "def", "getBgWriterStats", "(", "self", ")", ":", "info_dict", "=", "{", "}", "if", "self", ".", "checkVersion", "(", "'8.3'", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", "cursor_factory", "=", "psycopg2", ".", "extras", ".", "RealD...
Returns Global Background Writer and Checkpoint Activity stats. @return: Nested dictionary of stats.
[ "Returns", "Global", "Background", "Writer", "and", "Checkpoint", "Activity", "stats", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L262-L273
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getXlogStatus
def getXlogStatus(self): """Returns Transaction Logging or Recovery Status. @return: Dictionary of status items. """ inRecovery = None if self.checkVersion('9.0'): inRecovery = self._simpleQuery("SELECT pg_is_in_recovery();") cur = self._conn...
python
def getXlogStatus(self): """Returns Transaction Logging or Recovery Status. @return: Dictionary of status items. """ inRecovery = None if self.checkVersion('9.0'): inRecovery = self._simpleQuery("SELECT pg_is_in_recovery();") cur = self._conn...
[ "def", "getXlogStatus", "(", "self", ")", ":", "inRecovery", "=", "None", "if", "self", ".", "checkVersion", "(", "'9.0'", ")", ":", "inRecovery", "=", "self", ".", "_simpleQuery", "(", "\"SELECT pg_is_in_recovery();\"", ")", "cur", "=", "self", ".", "_conn"...
Returns Transaction Logging or Recovery Status. @return: Dictionary of status items.
[ "Returns", "Transaction", "Logging", "or", "Recovery", "Status", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L275-L306
aouyar/PyMunin
pysysinfo/postgresql.py
PgInfo.getSlaveStatus
def getSlaveStatus(self): """Returns status of replication slaves. @return: Dictionary of status items. """ info_dict = {} if self.checkVersion('9.1'): cols = ['procpid', 'usename', 'application_name', 'client_addr', 'client_port...
python
def getSlaveStatus(self): """Returns status of replication slaves. @return: Dictionary of status items. """ info_dict = {} if self.checkVersion('9.1'): cols = ['procpid', 'usename', 'application_name', 'client_addr', 'client_port...
[ "def", "getSlaveStatus", "(", "self", ")", ":", "info_dict", "=", "{", "}", "if", "self", ".", "checkVersion", "(", "'9.1'", ")", ":", "cols", "=", "[", "'procpid'", ",", "'usename'", ",", "'application_name'", ",", "'client_addr'", ",", "'client_port'", "...
Returns status of replication slaves. @return: Dictionary of status items.
[ "Returns", "status", "of", "replication", "slaves", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/postgresql.py#L308-L328
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo._connect
def _connect(self): """Establish connection to MySQL Database.""" if self._connParams: self._conn = MySQLdb.connect(**self._connParams) else: self._conn = MySQLdb.connect('')
python
def _connect(self): """Establish connection to MySQL Database.""" if self._connParams: self._conn = MySQLdb.connect(**self._connParams) else: self._conn = MySQLdb.connect('')
[ "def", "_connect", "(", "self", ")", ":", "if", "self", ".", "_connParams", ":", "self", ".", "_conn", "=", "MySQLdb", ".", "connect", "(", "*", "*", "self", ".", "_connParams", ")", "else", ":", "self", ".", "_conn", "=", "MySQLdb", ".", "connect", ...
Establish connection to MySQL Database.
[ "Establish", "connection", "to", "MySQL", "Database", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L64-L69
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getStorageEngines
def getStorageEngines(self): """Returns list of supported storage engines. @return: List of storage engine names. """ cur = self._conn.cursor() cur.execute("""SHOW STORAGE ENGINES;""") rows = cur.fetchall() if rows: return [row[0].low...
python
def getStorageEngines(self): """Returns list of supported storage engines. @return: List of storage engine names. """ cur = self._conn.cursor() cur.execute("""SHOW STORAGE ENGINES;""") rows = cur.fetchall() if rows: return [row[0].low...
[ "def", "getStorageEngines", "(", "self", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"SHOW STORAGE ENGINES;\"\"\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")", "if", "rows", ":", "return"...
Returns list of supported storage engines. @return: List of storage engine names.
[ "Returns", "list", "of", "supported", "storage", "engines", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L71-L83
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getParam
def getParam(self, key): """Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value. """ cur = self._conn.cursor() cur.execute("SHOW GLOBAL VARIABLES LIKE %s", key) row = cur.f...
python
def getParam(self, key): """Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value. """ cur = self._conn.cursor() cur.execute("SHOW GLOBAL VARIABLES LIKE %s", key) row = cur.f...
[ "def", "getParam", "(", "self", ",", "key", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"SHOW GLOBAL VARIABLES LIKE %s\"", ",", "key", ")", "row", "=", "cur", ".", "fetchone", "(", ")", "return", ...
Returns value of Run-time Database Parameter 'key'. @param key: Run-time parameter name. @return: Run-time parameter value.
[ "Returns", "value", "of", "Run", "-", "time", "Database", "Parameter", "key", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L85-L95
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getParams
def getParams(self): """Returns dictionary of all run-time parameters. @return: Dictionary of all Run-time parameters. """ cur = self._conn.cursor() cur.execute("SHOW GLOBAL VARIABLES") rows = cur.fetchall() info_dict = {} for row in rows...
python
def getParams(self): """Returns dictionary of all run-time parameters. @return: Dictionary of all Run-time parameters. """ cur = self._conn.cursor() cur.execute("SHOW GLOBAL VARIABLES") rows = cur.fetchall() info_dict = {} for row in rows...
[ "def", "getParams", "(", "self", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"SHOW GLOBAL VARIABLES\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")", "info_dict", "=", "{", "}", "for", "row...
Returns dictionary of all run-time parameters. @return: Dictionary of all Run-time parameters.
[ "Returns", "dictionary", "of", "all", "run", "-", "time", "parameters", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L97-L111
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getProcessStatus
def getProcessStatus(self): """Returns number of processes discriminated by state. @return: Dictionary mapping process state to number of processes. """ info_dict = {} cur = self._conn.cursor() cur.execute("""SHOW FULL PROCESSLIST;""") rows = cur...
python
def getProcessStatus(self): """Returns number of processes discriminated by state. @return: Dictionary mapping process state to number of processes. """ info_dict = {} cur = self._conn.cursor() cur.execute("""SHOW FULL PROCESSLIST;""") rows = cur...
[ "def", "getProcessStatus", "(", "self", ")", ":", "info_dict", "=", "{", "}", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"SHOW FULL PROCESSLIST;\"\"\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")",...
Returns number of processes discriminated by state. @return: Dictionary mapping process state to number of processes.
[ "Returns", "number", "of", "processes", "discriminated", "by", "state", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L129-L148
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getProcessDatabase
def getProcessDatabase(self): """Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes. """ info_dict = {} cur = self._conn.cursor() cur.execute("""SHOW FULL PROCESSLIST;""") ...
python
def getProcessDatabase(self): """Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes. """ info_dict = {} cur = self._conn.cursor() cur.execute("""SHOW FULL PROCESSLIST;""") ...
[ "def", "getProcessDatabase", "(", "self", ")", ":", "info_dict", "=", "{", "}", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"SHOW FULL PROCESSLIST;\"\"\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")...
Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes.
[ "Returns", "number", "of", "processes", "discriminated", "by", "database", "name", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L150-L164
aouyar/PyMunin
pysysinfo/mysql.py
MySQLinfo.getDatabases
def getDatabases(self): """Returns list of databases. @return: List of databases. """ cur = self._conn.cursor() cur.execute("""SHOW DATABASES;""") rows = cur.fetchall() if rows: return [row[0] for row in rows] else: ...
python
def getDatabases(self): """Returns list of databases. @return: List of databases. """ cur = self._conn.cursor() cur.execute("""SHOW DATABASES;""") rows = cur.fetchall() if rows: return [row[0] for row in rows] else: ...
[ "def", "getDatabases", "(", "self", ")", ":", "cur", "=", "self", ".", "_conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"SHOW DATABASES;\"\"\"", ")", "rows", "=", "cur", ".", "fetchall", "(", ")", "if", "rows", ":", "return", "[", ...
Returns list of databases. @return: List of databases.
[ "Returns", "list", "of", "databases", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/mysql.py#L166-L178
ContextLab/quail
quail/analysis/spc.py
spc_helper
def spc_helper(egg, match='exact', distance='euclidean', features=None): """ Computes probability of a word being recalled (in the appropriate recall list), given its presentation position Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or ...
python
def spc_helper(egg, match='exact', distance='euclidean', features=None): """ Computes probability of a word being recalled (in the appropriate recall list), given its presentation position Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or ...
[ "def", "spc_helper", "(", "egg", ",", "match", "=", "'exact'", ",", "distance", "=", "'euclidean'", ",", "features", "=", "None", ")", ":", "def", "spc", "(", "lst", ")", ":", "d", "=", "np", ".", "zeros_like", "(", "egg", ".", "pres", ".", "values...
Computes probability of a word being recalled (in the appropriate recall list), given its presentation position Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recall matrix. If exact, the presented and rec...
[ "Computes", "probability", "of", "a", "word", "being", "recalled", "(", "in", "the", "appropriate", "recall", "list", ")", "given", "its", "presentation", "position" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/spc.py#L4-L51
aouyar/PyMunin
pysysinfo/tomcat.py
TomcatInfo._retrieve
def _retrieve(self): """Query Apache Tomcat Server Status Page in XML format and return the result as an ElementTree object. @return: ElementTree object of Status Page XML. """ url = "%s://%s:%d/manager/status" % (self._proto, self._host, self._port) pa...
python
def _retrieve(self): """Query Apache Tomcat Server Status Page in XML format and return the result as an ElementTree object. @return: ElementTree object of Status Page XML. """ url = "%s://%s:%d/manager/status" % (self._proto, self._host, self._port) pa...
[ "def", "_retrieve", "(", "self", ")", ":", "url", "=", "\"%s://%s:%d/manager/status\"", "%", "(", "self", ".", "_proto", ",", "self", ".", "_host", ",", "self", ".", "_port", ")", "params", "=", "{", "}", "params", "[", "'XML'", "]", "=", "'true'", "...
Query Apache Tomcat Server Status Page in XML format and return the result as an ElementTree object. @return: ElementTree object of Status Page XML.
[ "Query", "Apache", "Tomcat", "Server", "Status", "Page", "in", "XML", "format", "and", "return", "the", "result", "as", "an", "ElementTree", "object", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/tomcat.py#L67-L79
aouyar/PyMunin
pysysinfo/tomcat.py
TomcatInfo.getMemoryStats
def getMemoryStats(self): """Return JVM Memory Stats for Apache Tomcat Server. @return: Dictionary of memory utilization stats. """ if self._statusxml is None: self.initStats() node = self._statusxml.find('jvm/memory') memstats = {} i...
python
def getMemoryStats(self): """Return JVM Memory Stats for Apache Tomcat Server. @return: Dictionary of memory utilization stats. """ if self._statusxml is None: self.initStats() node = self._statusxml.find('jvm/memory') memstats = {} i...
[ "def", "getMemoryStats", "(", "self", ")", ":", "if", "self", ".", "_statusxml", "is", "None", ":", "self", ".", "initStats", "(", ")", "node", "=", "self", ".", "_statusxml", ".", "find", "(", "'jvm/memory'", ")", "memstats", "=", "{", "}", "if", "n...
Return JVM Memory Stats for Apache Tomcat Server. @return: Dictionary of memory utilization stats.
[ "Return", "JVM", "Memory", "Stats", "for", "Apache", "Tomcat", "Server", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/tomcat.py#L85-L98
aouyar/PyMunin
pysysinfo/tomcat.py
TomcatInfo.getConnectorStats
def getConnectorStats(self): """Return dictionary of Connector Stats for Apache Tomcat Server. @return: Nested dictionary of Connector Stats. """ if self._statusxml is None: self.initStats() connnodes = self._statusxml.findall('connector') co...
python
def getConnectorStats(self): """Return dictionary of Connector Stats for Apache Tomcat Server. @return: Nested dictionary of Connector Stats. """ if self._statusxml is None: self.initStats() connnodes = self._statusxml.findall('connector') co...
[ "def", "getConnectorStats", "(", "self", ")", ":", "if", "self", ".", "_statusxml", "is", "None", ":", "self", ".", "initStats", "(", ")", "connnodes", "=", "self", ".", "_statusxml", ".", "findall", "(", "'connector'", ")", "connstats", "=", "{", "}", ...
Return dictionary of Connector Stats for Apache Tomcat Server. @return: Nested dictionary of Connector Stats.
[ "Return", "dictionary", "of", "Connector", "Stats", "for", "Apache", "Tomcat", "Server", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/tomcat.py#L100-L130
ContextLab/quail
quail/load.py
load
def load(filepath, update=True): """ Loads eggs, fried eggs ands example data Parameters ---------- filepath : str Location of file update : bool If true, updates egg to latest format Returns ---------- data : quail.Egg or quail.FriedEgg Data loaded from di...
python
def load(filepath, update=True): """ Loads eggs, fried eggs ands example data Parameters ---------- filepath : str Location of file update : bool If true, updates egg to latest format Returns ---------- data : quail.Egg or quail.FriedEgg Data loaded from di...
[ "def", "load", "(", "filepath", ",", "update", "=", "True", ")", ":", "if", "filepath", "==", "'automatic'", "or", "filepath", "==", "'example'", ":", "fpath", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "__fi...
Loads eggs, fried eggs ands example data Parameters ---------- filepath : str Location of file update : bool If true, updates egg to latest format Returns ---------- data : quail.Egg or quail.FriedEgg Data loaded from disk
[ "Loads", "eggs", "fried", "eggs", "ands", "example", "data" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/load.py#L22-L54
ContextLab/quail
quail/load.py
load_fegg
def load_fegg(filepath, update=True): """ Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg """ try: ...
python
def load_fegg(filepath, update=True): """ Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg """ try: ...
[ "def", "load_fegg", "(", "filepath", ",", "update", "=", "True", ")", ":", "try", ":", "egg", "=", "FriedEgg", "(", "*", "*", "dd", ".", "io", ".", "load", "(", "filepath", ")", ")", "except", "ValueError", "as", "e", ":", "print", "(", "e", ")",...
Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg
[ "Loads", "pickled", "egg" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/load.py#L56-L85
ContextLab/quail
quail/load.py
load_egg
def load_egg(filepath, update=True): """ Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg """ try: ...
python
def load_egg(filepath, update=True): """ Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg """ try: ...
[ "def", "load_egg", "(", "filepath", ",", "update", "=", "True", ")", ":", "try", ":", "egg", "=", "Egg", "(", "*", "*", "dd", ".", "io", ".", "load", "(", "filepath", ")", ")", "except", ":", "# if error, try loading old format", "with", "open", "(", ...
Loads pickled egg Parameters ---------- filepath : str Location of pickled egg update : bool If true, updates egg to latest format Returns ---------- egg : Egg data object A loaded unpickled egg
[ "Loads", "pickled", "egg" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/load.py#L87-L121
ContextLab/quail
quail/load.py
loadEL
def loadEL(dbpath=None, recpath=None, remove_subs=None, wordpool=None, groupby=None, experiments=None, filters=None): ''' Function that loads sql files generated by autoFR Experiment ''' assert (dbpath is not None), "You must specify a db file or files." assert (recpath is not None), "You must ...
python
def loadEL(dbpath=None, recpath=None, remove_subs=None, wordpool=None, groupby=None, experiments=None, filters=None): ''' Function that loads sql files generated by autoFR Experiment ''' assert (dbpath is not None), "You must specify a db file or files." assert (recpath is not None), "You must ...
[ "def", "loadEL", "(", "dbpath", "=", "None", ",", "recpath", "=", "None", ",", "remove_subs", "=", "None", ",", "wordpool", "=", "None", ",", "groupby", "=", "None", ",", "experiments", "=", "None", ",", "filters", "=", "None", ")", ":", "assert", "(...
Function that loads sql files generated by autoFR Experiment
[ "Function", "that", "loads", "sql", "files", "generated", "by", "autoFR", "Experiment" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/load.py#L123-L514
ContextLab/quail
quail/load.py
load_example_data
def load_example_data(dataset='automatic'): """ Loads example data The automatic and manual example data are eggs containing 30 subjects who completed a free recall experiment as described here: https://psyarxiv.com/psh48/. The subjects studied 8 lists of 16 words each and then performed a free rec...
python
def load_example_data(dataset='automatic'): """ Loads example data The automatic and manual example data are eggs containing 30 subjects who completed a free recall experiment as described here: https://psyarxiv.com/psh48/. The subjects studied 8 lists of 16 words each and then performed a free rec...
[ "def", "load_example_data", "(", "dataset", "=", "'automatic'", ")", ":", "# can only be auto or manual", "assert", "dataset", "in", "[", "'automatic'", ",", "'manual'", ",", "'naturalistic'", "]", ",", "\"Dataset can only be automatic, manual, or naturalistic\"", "if", "...
Loads example data The automatic and manual example data are eggs containing 30 subjects who completed a free recall experiment as described here: https://psyarxiv.com/psh48/. The subjects studied 8 lists of 16 words each and then performed a free recall test. The naturalistic example data is is an eg...
[ "Loads", "example", "data" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/load.py#L516-L564
aouyar/PyMunin
pymunin/plugins/fsstats.py
MuninFreeswitchPlugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" fs = FSinfo(self._fshost, self._fsport, self._fspass) if self.hasGraph('fs_calls'): count = fs.getCallCount() self.setGraphVal('fs_calls', 'calls', count) if self.hasGraph('fs_channels'): count ...
python
def retrieveVals(self): """Retrieve values for graphs.""" fs = FSinfo(self._fshost, self._fsport, self._fspass) if self.hasGraph('fs_calls'): count = fs.getCallCount() self.setGraphVal('fs_calls', 'calls', count) if self.hasGraph('fs_channels'): count ...
[ "def", "retrieveVals", "(", "self", ")", ":", "fs", "=", "FSinfo", "(", "self", ".", "_fshost", ",", "self", ".", "_fsport", ",", "self", ".", "_fspass", ")", "if", "self", ".", "hasGraph", "(", "'fs_calls'", ")", ":", "count", "=", "fs", ".", "get...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/fsstats.py#L100-L108
aouyar/PyMunin
pymunin/plugins/fsstats.py
MuninFreeswitchPlugin.autoconf
def autoconf(self): """Implements Munin Plugin Auto-Configuration Option. @return: True if plugin can be auto-configured, False otherwise. """ fs = FSinfo(self._fshost, self._fsport, self._fspass) return fs is not None
python
def autoconf(self): """Implements Munin Plugin Auto-Configuration Option. @return: True if plugin can be auto-configured, False otherwise. """ fs = FSinfo(self._fshost, self._fsport, self._fspass) return fs is not None
[ "def", "autoconf", "(", "self", ")", ":", "fs", "=", "FSinfo", "(", "self", ".", "_fshost", ",", "self", ".", "_fsport", ",", "self", ".", "_fspass", ")", "return", "fs", "is", "not", "None" ]
Implements Munin Plugin Auto-Configuration Option. @return: True if plugin can be auto-configured, False otherwise.
[ "Implements", "Munin", "Plugin", "Auto", "-", "Configuration", "Option", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/fsstats.py#L110-L117
scikit-umfpack/scikit-umfpack
scikits/umfpack/interface.py
spsolve
def spsolve(A, b): """Solve the sparse linear system Ax=b, where b may be a vector or a matrix. Parameters ---------- A : ndarray or sparse matrix The square matrix A will be converted into CSC or CSR form b : ndarray or sparse matrix The matrix or vector representing the right hand...
python
def spsolve(A, b): """Solve the sparse linear system Ax=b, where b may be a vector or a matrix. Parameters ---------- A : ndarray or sparse matrix The square matrix A will be converted into CSC or CSR form b : ndarray or sparse matrix The matrix or vector representing the right hand...
[ "def", "spsolve", "(", "A", ",", "b", ")", ":", "x", "=", "UmfpackLU", "(", "A", ")", ".", "solve", "(", "b", ")", "if", "b", ".", "ndim", "==", "2", "and", "b", ".", "shape", "[", "1", "]", "==", "1", ":", "# compatibility with scipy.sparse.spso...
Solve the sparse linear system Ax=b, where b may be a vector or a matrix. Parameters ---------- A : ndarray or sparse matrix The square matrix A will be converted into CSC or CSR form b : ndarray or sparse matrix The matrix or vector representing the right hand side of the equation. ...
[ "Solve", "the", "sparse", "linear", "system", "Ax", "=", "b", "where", "b", "may", "be", "a", "vector", "or", "a", "matrix", "." ]
train
https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/interface.py#L44-L68
scikit-umfpack/scikit-umfpack
scikits/umfpack/interface.py
UmfpackLU.solve
def solve(self, b): """ Solve linear equation A x = b for x Parameters ---------- b : ndarray Right-hand side of the matrix equation. Can be vector or a matrix. Returns ------- x : ndarray Solution to the matrix equation ...
python
def solve(self, b): """ Solve linear equation A x = b for x Parameters ---------- b : ndarray Right-hand side of the matrix equation. Can be vector or a matrix. Returns ------- x : ndarray Solution to the matrix equation ...
[ "def", "solve", "(", "self", ",", "b", ")", ":", "if", "isspmatrix", "(", "b", ")", ":", "b", "=", "b", ".", "toarray", "(", ")", "if", "b", ".", "shape", "[", "0", "]", "!=", "self", ".", "_A", ".", "shape", "[", "1", "]", ":", "raise", ...
Solve linear equation A x = b for x Parameters ---------- b : ndarray Right-hand side of the matrix equation. Can be vector or a matrix. Returns ------- x : ndarray Solution to the matrix equation
[ "Solve", "linear", "equation", "A", "x", "=", "b", "for", "x" ]
train
https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/interface.py#L215-L240
scikit-umfpack/scikit-umfpack
scikits/umfpack/interface.py
UmfpackLU.solve_sparse
def solve_sparse(self, B): """ Solve linear equation of the form A X = B. Where B and X are sparse matrices. Parameters ---------- B : any scipy.sparse matrix Right-hand side of the matrix equation. Note: it will be converted to csc_matrix via `.tocsc()`....
python
def solve_sparse(self, B): """ Solve linear equation of the form A X = B. Where B and X are sparse matrices. Parameters ---------- B : any scipy.sparse matrix Right-hand side of the matrix equation. Note: it will be converted to csc_matrix via `.tocsc()`....
[ "def", "solve_sparse", "(", "self", ",", "B", ")", ":", "B", "=", "B", ".", "tocsc", "(", ")", "cols", "=", "list", "(", ")", "for", "j", "in", "xrange", "(", "B", ".", "shape", "[", "1", "]", ")", ":", "col", "=", "self", ".", "solve", "("...
Solve linear equation of the form A X = B. Where B and X are sparse matrices. Parameters ---------- B : any scipy.sparse matrix Right-hand side of the matrix equation. Note: it will be converted to csc_matrix via `.tocsc()`. Returns ------- X : c...
[ "Solve", "linear", "equation", "of", "the", "form", "A", "X", "=", "B", ".", "Where", "B", "and", "X", "are", "sparse", "matrices", "." ]
train
https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/interface.py#L242-L262
ContextLab/quail
quail/analysis/recmat.py
recall_matrix
def recall_matrix(egg, match='exact', distance='euclidean', features=None): """ Computes recall matrix given list of presented and list of recalled words Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recal...
python
def recall_matrix(egg, match='exact', distance='euclidean', features=None): """ Computes recall matrix given list of presented and list of recalled words Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recal...
[ "def", "recall_matrix", "(", "egg", ",", "match", "=", "'exact'", ",", "distance", "=", "'euclidean'", ",", "features", "=", "None", ")", ":", "if", "match", "in", "[", "'best'", ",", "'smooth'", "]", ":", "if", "not", "features", ":", "features", "=",...
Computes recall matrix given list of presented and list of recalled words Parameters ---------- egg : quail.Egg Data to analyze match : str (exact, best or smooth) Matching approach to compute recall matrix. If exact, the presented and recalled items must be identical (default...
[ "Computes", "recall", "matrix", "given", "list", "of", "presented", "and", "list", "of", "recalled", "words" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/recmat.py#L7-L51
aouyar/PyMunin
pymunin/plugins/netstats.py
MuninNetstatsPlugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" net_info = NetstatInfo() if self.hasGraph('netstat_conn_status'): stats = net_info.getTCPportConnStatus(include_listen=True) for fname in ('listen', 'established', 'syn_sent', 'syn_recv', ...
python
def retrieveVals(self): """Retrieve values for graphs.""" net_info = NetstatInfo() if self.hasGraph('netstat_conn_status'): stats = net_info.getTCPportConnStatus(include_listen=True) for fname in ('listen', 'established', 'syn_sent', 'syn_recv', ...
[ "def", "retrieveVals", "(", "self", ")", ":", "net_info", "=", "NetstatInfo", "(", ")", "if", "self", ".", "hasGraph", "(", "'netstat_conn_status'", ")", ":", "stats", "=", "net_info", ".", "getTCPportConnStatus", "(", "include_listen", "=", "True", ")", "fo...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/netstats.py#L122-L139
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._parseFreePBXconf
def _parseFreePBXconf(self): """Parses FreePBX configuration file /etc/amportal for user and password for Asterisk Manager Interface. @return: True if configuration file is found and parsed successfully. """ amiuser = None amipass = None if os.pa...
python
def _parseFreePBXconf(self): """Parses FreePBX configuration file /etc/amportal for user and password for Asterisk Manager Interface. @return: True if configuration file is found and parsed successfully. """ amiuser = None amipass = None if os.pa...
[ "def", "_parseFreePBXconf", "(", "self", ")", ":", "amiuser", "=", "None", "amipass", "=", "None", "if", "os", ".", "path", ".", "isfile", "(", "confFileFreePBX", ")", ":", "try", ":", "fp", "=", "open", "(", "confFileFreePBX", ",", "'r'", ")", "data",...
Parses FreePBX configuration file /etc/amportal for user and password for Asterisk Manager Interface. @return: True if configuration file is found and parsed successfully.
[ "Parses", "FreePBX", "configuration", "file", "/", "etc", "/", "amportal", "for", "user", "and", "password", "for", "Asterisk", "Manager", "Interface", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L85-L112
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._parseAsteriskConf
def _parseAsteriskConf(self): """Parses Asterisk configuration file /etc/asterisk/manager.conf for user and password for Manager Interface. Returns True on success. @return: True if configuration file is found and parsed successfully. """ if os.path.isfile(confF...
python
def _parseAsteriskConf(self): """Parses Asterisk configuration file /etc/asterisk/manager.conf for user and password for Manager Interface. Returns True on success. @return: True if configuration file is found and parsed successfully. """ if os.path.isfile(confF...
[ "def", "_parseAsteriskConf", "(", "self", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "confFileAMI", ")", ":", "try", ":", "fp", "=", "open", "(", "confFileAMI", ",", "'r'", ")", "data", "=", "fp", ".", "read", "(", ")", "fp", ".", "cl...
Parses Asterisk configuration file /etc/asterisk/manager.conf for user and password for Manager Interface. Returns True on success. @return: True if configuration file is found and parsed successfully.
[ "Parses", "Asterisk", "configuration", "file", "/", "etc", "/", "asterisk", "/", "manager", ".", "conf", "for", "user", "and", "password", "for", "Manager", "Interface", ".", "Returns", "True", "on", "success", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L114-L135
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._connect
def _connect(self): """Connect to Asterisk Manager Interface.""" try: if sys.version_info[:2] >= (2,6): self._conn = telnetlib.Telnet(self._amihost, self._amiport, connTimeout) else: self._conn = telne...
python
def _connect(self): """Connect to Asterisk Manager Interface.""" try: if sys.version_info[:2] >= (2,6): self._conn = telnetlib.Telnet(self._amihost, self._amiport, connTimeout) else: self._conn = telne...
[ "def", "_connect", "(", "self", ")", ":", "try", ":", "if", "sys", ".", "version_info", "[", ":", "2", "]", ">=", "(", "2", ",", "6", ")", ":", "self", ".", "_conn", "=", "telnetlib", ".", "Telnet", "(", "self", ".", "_amihost", ",", "self", "....
Connect to Asterisk Manager Interface.
[ "Connect", "to", "Asterisk", "Manager", "Interface", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L137-L150
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._sendAction
def _sendAction(self, action, attrs=None, chan_vars=None): """Send action to Asterisk Manager Interface. @param action: Action name @param attrs: Tuple of key-value pairs for action attributes. @param chan_vars: Tuple of key-value pairs for channel variables. """...
python
def _sendAction(self, action, attrs=None, chan_vars=None): """Send action to Asterisk Manager Interface. @param action: Action name @param attrs: Tuple of key-value pairs for action attributes. @param chan_vars: Tuple of key-value pairs for channel variables. """...
[ "def", "_sendAction", "(", "self", ",", "action", ",", "attrs", "=", "None", ",", "chan_vars", "=", "None", ")", ":", "self", ".", "_conn", ".", "write", "(", "\"Action: %s\\r\\n\"", "%", "action", ")", "if", "attrs", ":", "for", "(", "key", ",", "va...
Send action to Asterisk Manager Interface. @param action: Action name @param attrs: Tuple of key-value pairs for action attributes. @param chan_vars: Tuple of key-value pairs for channel variables.
[ "Send", "action", "to", "Asterisk", "Manager", "Interface", ".", "@param", "action", ":", "Action", "name", "@param", "attrs", ":", "Tuple", "of", "key", "-", "value", "pairs", "for", "action", "attributes", ".", "@param", "chan_vars", ":", "Tuple", "of", ...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L152-L167
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._getResponse
def _getResponse(self): """Read and parse response from Asterisk Manager Interface. @return: Dictionary with response key-value pairs. """ resp_dict= dict() resp_str = self._conn.read_until("\r\n\r\n", connTimeout) for line in resp_str.split("\r\n"): ...
python
def _getResponse(self): """Read and parse response from Asterisk Manager Interface. @return: Dictionary with response key-value pairs. """ resp_dict= dict() resp_str = self._conn.read_until("\r\n\r\n", connTimeout) for line in resp_str.split("\r\n"): ...
[ "def", "_getResponse", "(", "self", ")", ":", "resp_dict", "=", "dict", "(", ")", "resp_str", "=", "self", ".", "_conn", ".", "read_until", "(", "\"\\r\\n\\r\\n\"", ",", "connTimeout", ")", "for", "line", "in", "resp_str", ".", "split", "(", "\"\\r\\n\"", ...
Read and parse response from Asterisk Manager Interface. @return: Dictionary with response key-value pairs.
[ "Read", "and", "parse", "response", "from", "Asterisk", "Manager", "Interface", ".", "@return", ":", "Dictionary", "with", "response", "key", "-", "value", "pairs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L169-L185
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._getGreeting
def _getGreeting(self): """Read and parse Asterisk Manager Interface Greeting to determine and set Manager Interface version. """ greeting = self._conn.read_until("\r\n", connTimeout) mobj = re.match('Asterisk Call Manager\/([\d\.]+)\s*$', greeting) if mobj: ...
python
def _getGreeting(self): """Read and parse Asterisk Manager Interface Greeting to determine and set Manager Interface version. """ greeting = self._conn.read_until("\r\n", connTimeout) mobj = re.match('Asterisk Call Manager\/([\d\.]+)\s*$', greeting) if mobj: ...
[ "def", "_getGreeting", "(", "self", ")", ":", "greeting", "=", "self", ".", "_conn", ".", "read_until", "(", "\"\\r\\n\"", ",", "connTimeout", ")", "mobj", "=", "re", ".", "match", "(", "'Asterisk Call Manager\\/([\\d\\.]+)\\s*$'", ",", "greeting", ")", "if", ...
Read and parse Asterisk Manager Interface Greeting to determine and set Manager Interface version.
[ "Read", "and", "parse", "Asterisk", "Manager", "Interface", "Greeting", "to", "determine", "and", "set", "Manager", "Interface", "version", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L192-L202
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._initAsteriskVersion
def _initAsteriskVersion(self): """Query Asterisk Manager Interface for Asterisk Version to configure system for compatibility with multiple versions . CLI Command - core show version """ if self._ami_version > util.SoftwareVersion('1.0'): cmd = "core show ve...
python
def _initAsteriskVersion(self): """Query Asterisk Manager Interface for Asterisk Version to configure system for compatibility with multiple versions . CLI Command - core show version """ if self._ami_version > util.SoftwareVersion('1.0'): cmd = "core show ve...
[ "def", "_initAsteriskVersion", "(", "self", ")", ":", "if", "self", ".", "_ami_version", ">", "util", ".", "SoftwareVersion", "(", "'1.0'", ")", ":", "cmd", "=", "\"core show version\"", "else", ":", "cmd", "=", "\"show version\"", "cmdresp", "=", "self", "....
Query Asterisk Manager Interface for Asterisk Version to configure system for compatibility with multiple versions . CLI Command - core show version
[ "Query", "Asterisk", "Manager", "Interface", "for", "Asterisk", "Version", "to", "configure", "system", "for", "compatibility", "with", "multiple", "versions", ".", "CLI", "Command", "-", "core", "show", "version" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L204-L220
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._login
def _login(self): """Login to Asterisk Manager Interface.""" self._sendAction("login", ( ("Username", self._amiuser), ("Secret", self._amipass), ("Events", "off"), )) resp = self._getResponse() if resp.get("Response") == "Success": ...
python
def _login(self): """Login to Asterisk Manager Interface.""" self._sendAction("login", ( ("Username", self._amiuser), ("Secret", self._amipass), ("Events", "off"), )) resp = self._getResponse() if resp.get("Response") == "Success": ...
[ "def", "_login", "(", "self", ")", ":", "self", ".", "_sendAction", "(", "\"login\"", ",", "(", "(", "\"Username\"", ",", "self", ".", "_amiuser", ")", ",", "(", "\"Secret\"", ",", "self", ".", "_amipass", ")", ",", "(", "\"Events\"", ",", "\"off\"", ...
Login to Asterisk Manager Interface.
[ "Login", "to", "Asterisk", "Manager", "Interface", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L222-L233
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.executeCommand
def executeCommand(self, command): """Send Action to Asterisk Manager Interface to execute CLI Command. @param command: CLI command to execute. @return: Command response string. """ self._sendAction("Command", ( ("Command", command), )) ...
python
def executeCommand(self, command): """Send Action to Asterisk Manager Interface to execute CLI Command. @param command: CLI command to execute. @return: Command response string. """ self._sendAction("Command", ( ("Command", command), )) ...
[ "def", "executeCommand", "(", "self", ",", "command", ")", ":", "self", ".", "_sendAction", "(", "\"Command\"", ",", "(", "(", "\"Command\"", ",", "command", ")", ",", ")", ")", "resp", "=", "self", ".", "_getResponse", "(", ")", "result", "=", "resp",...
Send Action to Asterisk Manager Interface to execute CLI Command. @param command: CLI command to execute. @return: Command response string.
[ "Send", "Action", "to", "Asterisk", "Manager", "Interface", "to", "execute", "CLI", "Command", ".", "@param", "command", ":", "CLI", "command", "to", "execute", ".", "@return", ":", "Command", "response", "string", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L235-L255
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._initModuleList
def _initModuleList(self): """Query Asterisk Manager Interface to initialize internal list of loaded modules. CLI Command - core show modules """ if self.checkVersion('1.4'): cmd = "module show" else: cmd = "show modules" ...
python
def _initModuleList(self): """Query Asterisk Manager Interface to initialize internal list of loaded modules. CLI Command - core show modules """ if self.checkVersion('1.4'): cmd = "module show" else: cmd = "show modules" ...
[ "def", "_initModuleList", "(", "self", ")", ":", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"module show\"", "else", ":", "cmd", "=", "\"show modules\"", "cmdresp", "=", "self", ".", "executeCommand", "(", "cmd", ")", "self", ...
Query Asterisk Manager Interface to initialize internal list of loaded modules. CLI Command - core show modules
[ "Query", "Asterisk", "Manager", "Interface", "to", "initialize", "internal", "list", "of", "loaded", "modules", ".", "CLI", "Command", "-", "core", "show", "modules" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L257-L273
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._initApplicationList
def _initApplicationList(self): """Query Asterisk Manager Interface to initialize internal list of available applications. CLI Command - core show applications """ if self.checkVersion('1.4'): cmd = "core show applications" else: ...
python
def _initApplicationList(self): """Query Asterisk Manager Interface to initialize internal list of available applications. CLI Command - core show applications """ if self.checkVersion('1.4'): cmd = "core show applications" else: ...
[ "def", "_initApplicationList", "(", "self", ")", ":", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"core show applications\"", "else", ":", "cmd", "=", "\"show applications\"", "cmdresp", "=", "self", ".", "executeCommand", "(", "cm...
Query Asterisk Manager Interface to initialize internal list of available applications. CLI Command - core show applications
[ "Query", "Asterisk", "Manager", "Interface", "to", "initialize", "internal", "list", "of", "available", "applications", ".", "CLI", "Command", "-", "core", "show", "applications" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L275-L291
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo._initChannelTypesList
def _initChannelTypesList(self): """Query Asterisk Manager Interface to initialize internal list of supported channel types. CLI Command - core show applications """ if self.checkVersion('1.4'): cmd = "core show channeltypes" else: ...
python
def _initChannelTypesList(self): """Query Asterisk Manager Interface to initialize internal list of supported channel types. CLI Command - core show applications """ if self.checkVersion('1.4'): cmd = "core show channeltypes" else: ...
[ "def", "_initChannelTypesList", "(", "self", ")", ":", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"core show channeltypes\"", "else", ":", "cmd", "=", "\"show channeltypes\"", "cmdresp", "=", "self", ".", "executeCommand", "(", "c...
Query Asterisk Manager Interface to initialize internal list of supported channel types. CLI Command - core show applications
[ "Query", "Asterisk", "Manager", "Interface", "to", "initialize", "internal", "list", "of", "supported", "channel", "types", ".", "CLI", "Command", "-", "core", "show", "applications" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L293-L309
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.hasModule
def hasModule(self, mod): """Returns True if mod is among the loaded modules. @param mod: Module name. @return: Boolean """ if self._modules is None: self._initModuleList() return mod in self._modules
python
def hasModule(self, mod): """Returns True if mod is among the loaded modules. @param mod: Module name. @return: Boolean """ if self._modules is None: self._initModuleList() return mod in self._modules
[ "def", "hasModule", "(", "self", ",", "mod", ")", ":", "if", "self", ".", "_modules", "is", "None", ":", "self", ".", "_initModuleList", "(", ")", "return", "mod", "in", "self", ".", "_modules" ]
Returns True if mod is among the loaded modules. @param mod: Module name. @return: Boolean
[ "Returns", "True", "if", "mod", "is", "among", "the", "loaded", "modules", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L328-L337
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.hasApplication
def hasApplication(self, app): """Returns True if app is among the loaded modules. @param app: Module name. @return: Boolean """ if self._applications is None: self._initApplicationList() return app in self._applications
python
def hasApplication(self, app): """Returns True if app is among the loaded modules. @param app: Module name. @return: Boolean """ if self._applications is None: self._initApplicationList() return app in self._applications
[ "def", "hasApplication", "(", "self", ",", "app", ")", ":", "if", "self", ".", "_applications", "is", "None", ":", "self", ".", "_initApplicationList", "(", ")", "return", "app", "in", "self", ".", "_applications" ]
Returns True if app is among the loaded modules. @param app: Module name. @return: Boolean
[ "Returns", "True", "if", "app", "is", "among", "the", "loaded", "modules", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L339-L348
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.hasChannelType
def hasChannelType(self, chan): """Returns True if chan is among the supported channel types. @param app: Module name. @return: Boolean """ if self._chantypes is None: self._initChannelTypesList() return chan in self._chantypes
python
def hasChannelType(self, chan): """Returns True if chan is among the supported channel types. @param app: Module name. @return: Boolean """ if self._chantypes is None: self._initChannelTypesList() return chan in self._chantypes
[ "def", "hasChannelType", "(", "self", ",", "chan", ")", ":", "if", "self", ".", "_chantypes", "is", "None", ":", "self", ".", "_initChannelTypesList", "(", ")", "return", "chan", "in", "self", ".", "_chantypes" ]
Returns True if chan is among the supported channel types. @param app: Module name. @return: Boolean
[ "Returns", "True", "if", "chan", "is", "among", "the", "supported", "channel", "types", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L350-L359
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getCodecList
def getCodecList(self): """Query Asterisk Manager Interface for defined codecs. CLI Command - core show codecs @return: Dictionary - Short Name -> (Type, Long Name) """ if self.checkVersion('1.4'): cmd = "core show codecs" else: ...
python
def getCodecList(self): """Query Asterisk Manager Interface for defined codecs. CLI Command - core show codecs @return: Dictionary - Short Name -> (Type, Long Name) """ if self.checkVersion('1.4'): cmd = "core show codecs" else: ...
[ "def", "getCodecList", "(", "self", ")", ":", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"core show codecs\"", "else", ":", "cmd", "=", "\"show codecs\"", "cmdresp", "=", "self", ".", "executeCommand", "(", "cmd", ")", "info_d...
Query Asterisk Manager Interface for defined codecs. CLI Command - core show codecs @return: Dictionary - Short Name -> (Type, Long Name)
[ "Query", "Asterisk", "Manager", "Interface", "for", "defined", "codecs", ".", "CLI", "Command", "-", "core", "show", "codecs" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L392-L411
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getChannelStats
def getChannelStats(self, chantypes=('dahdi', 'zap', 'sip', 'iax2', 'local')): """Query Asterisk Manager Interface for Channel Stats. CLI Command - core show channels @return: Dictionary of statistics counters for channels. Number of active channels for each channel type. ...
python
def getChannelStats(self, chantypes=('dahdi', 'zap', 'sip', 'iax2', 'local')): """Query Asterisk Manager Interface for Channel Stats. CLI Command - core show channels @return: Dictionary of statistics counters for channels. Number of active channels for each channel type. ...
[ "def", "getChannelStats", "(", "self", ",", "chantypes", "=", "(", "'dahdi'", ",", "'zap'", ",", "'sip'", ",", "'iax2'", ",", "'local'", ")", ")", ":", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"core show channels\"", "else...
Query Asterisk Manager Interface for Channel Stats. CLI Command - core show channels @return: Dictionary of statistics counters for channels. Number of active channels for each channel type.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Channel", "Stats", ".", "CLI", "Command", "-", "core", "show", "channels" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L413-L464
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getPeerStats
def getPeerStats(self, chantype): """Query Asterisk Manager Interface for SIP / IAX2 Peer Stats. CLI Command - sip show peers iax2 show peers @param chantype: Must be 'sip' or 'iax2'. @return: Dictionary of statistics counters for VoIP Peer...
python
def getPeerStats(self, chantype): """Query Asterisk Manager Interface for SIP / IAX2 Peer Stats. CLI Command - sip show peers iax2 show peers @param chantype: Must be 'sip' or 'iax2'. @return: Dictionary of statistics counters for VoIP Peer...
[ "def", "getPeerStats", "(", "self", ",", "chantype", ")", ":", "chan", "=", "chantype", ".", "lower", "(", ")", "if", "not", "self", ".", "hasChannelType", "(", "chan", ")", ":", "return", "None", "if", "chan", "==", "'iax2'", ":", "cmd", "=", "\"iax...
Query Asterisk Manager Interface for SIP / IAX2 Peer Stats. CLI Command - sip show peers iax2 show peers @param chantype: Must be 'sip' or 'iax2'. @return: Dictionary of statistics counters for VoIP Peers.
[ "Query", "Asterisk", "Manager", "Interface", "for", "SIP", "/", "IAX2", "Peer", "Stats", ".", "CLI", "Command", "-", "sip", "show", "peers", "iax2", "show", "peers", "@param", "chantype", ":", "Must", "be", "sip", "or", "iax2", ".", "@return", ":", "Dict...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L466-L499
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getVoIPchanStats
def getVoIPchanStats(self, chantype, codec_list=('ulaw', 'alaw', 'gsm', 'g729')): """Query Asterisk Manager Interface for SIP / IAX2 Channel / Codec Stats. CLI Commands - sip show channels iax2 show channnels @param chantype: M...
python
def getVoIPchanStats(self, chantype, codec_list=('ulaw', 'alaw', 'gsm', 'g729')): """Query Asterisk Manager Interface for SIP / IAX2 Channel / Codec Stats. CLI Commands - sip show channels iax2 show channnels @param chantype: M...
[ "def", "getVoIPchanStats", "(", "self", ",", "chantype", ",", "codec_list", "=", "(", "'ulaw'", ",", "'alaw'", ",", "'gsm'", ",", "'g729'", ")", ")", ":", "chan", "=", "chantype", ".", "lower", "(", ")", "if", "not", "self", ".", "hasChannelType", "(",...
Query Asterisk Manager Interface for SIP / IAX2 Channel / Codec Stats. CLI Commands - sip show channels iax2 show channnels @param chantype: Must be 'sip' or 'iax2'. @param codec_list: List of codec names to parse. (Codecs not...
[ "Query", "Asterisk", "Manager", "Interface", "for", "SIP", "/", "IAX2", "Channel", "/", "Codec", "Stats", ".", "CLI", "Commands", "-", "sip", "show", "channels", "iax2", "show", "channnels", "@param", "chantype", ":", "Must", "be", "sip", "or", "iax2", "."...
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L501-L554
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getConferenceStats
def getConferenceStats(self): """Query Asterisk Manager Interface for Conference Room Stats. CLI Command - meetme list @return: Dictionary of statistics counters for Conference Rooms. """ if not self.hasConference(): return None if self.checkVersion...
python
def getConferenceStats(self): """Query Asterisk Manager Interface for Conference Room Stats. CLI Command - meetme list @return: Dictionary of statistics counters for Conference Rooms. """ if not self.hasConference(): return None if self.checkVersion...
[ "def", "getConferenceStats", "(", "self", ")", ":", "if", "not", "self", ".", "hasConference", "(", ")", ":", "return", "None", "if", "self", ".", "checkVersion", "(", "'1.6'", ")", ":", "cmd", "=", "\"meetme list\"", "else", ":", "cmd", "=", "\"meetme\"...
Query Asterisk Manager Interface for Conference Room Stats. CLI Command - meetme list @return: Dictionary of statistics counters for Conference Rooms.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Conference", "Room", "Stats", ".", "CLI", "Command", "-", "meetme", "list" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L564-L587
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getVoicemailStats
def getVoicemailStats(self): """Query Asterisk Manager Interface for Voicemail Stats. CLI Command - voicemail show users @return: Dictionary of statistics counters for Voicemail Accounts. """ if not self.hasVoicemail(): return None if self.checkVers...
python
def getVoicemailStats(self): """Query Asterisk Manager Interface for Voicemail Stats. CLI Command - voicemail show users @return: Dictionary of statistics counters for Voicemail Accounts. """ if not self.hasVoicemail(): return None if self.checkVers...
[ "def", "getVoicemailStats", "(", "self", ")", ":", "if", "not", "self", ".", "hasVoicemail", "(", ")", ":", "return", "None", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"voicemail show users\"", "else", ":", "cmd", "=", "\"s...
Query Asterisk Manager Interface for Voicemail Stats. CLI Command - voicemail show users @return: Dictionary of statistics counters for Voicemail Accounts.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Voicemail", "Stats", ".", "CLI", "Command", "-", "voicemail", "show", "users" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L597-L627
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getTrunkStats
def getTrunkStats(self, trunkList): """Query Asterisk Manager Interface for Trunk Stats. CLI Command - core show channels @param trunkList: List of tuples of one of the two following types: (Trunk Name, Regular Expression) (Trunk ...
python
def getTrunkStats(self, trunkList): """Query Asterisk Manager Interface for Trunk Stats. CLI Command - core show channels @param trunkList: List of tuples of one of the two following types: (Trunk Name, Regular Expression) (Trunk ...
[ "def", "getTrunkStats", "(", "self", ",", "trunkList", ")", ":", "re_list", "=", "[", "]", "info_dict", "=", "{", "}", "for", "filt", "in", "trunkList", ":", "info_dict", "[", "filt", "[", "0", "]", "]", "=", "0", "re_list", ".", "append", "(", "re...
Query Asterisk Manager Interface for Trunk Stats. CLI Command - core show channels @param trunkList: List of tuples of one of the two following types: (Trunk Name, Regular Expression) (Trunk Name, Regular Expression, MIN, MAX) @re...
[ "Query", "Asterisk", "Manager", "Interface", "for", "Trunk", "Stats", ".", "CLI", "Command", "-", "core", "show", "channels" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L629-L668
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getQueueStats
def getQueueStats(self): """Query Asterisk Manager Interface for Queue Stats. CLI Command: queue show @return: Dictionary of queue stats. """ if not self.hasQueue(): return None info_dict = {} if self.checkVersion('1.4'): ...
python
def getQueueStats(self): """Query Asterisk Manager Interface for Queue Stats. CLI Command: queue show @return: Dictionary of queue stats. """ if not self.hasQueue(): return None info_dict = {} if self.checkVersion('1.4'): ...
[ "def", "getQueueStats", "(", "self", ")", ":", "if", "not", "self", ".", "hasQueue", "(", ")", ":", "return", "None", "info_dict", "=", "{", "}", "if", "self", ".", "checkVersion", "(", "'1.4'", ")", ":", "cmd", "=", "\"queue show\"", "else", ":", "c...
Query Asterisk Manager Interface for Queue Stats. CLI Command: queue show @return: Dictionary of queue stats.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Queue", "Stats", ".", "CLI", "Command", ":", "queue", "show" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L678-L743
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getFaxStatsCounters
def getFaxStatsCounters(self): """Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show stats @return: Dictionary of fax stats. """ if not self.hasFax(): return None info_dict = {} cmdresp = self.executeComma...
python
def getFaxStatsCounters(self): """Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show stats @return: Dictionary of fax stats. """ if not self.hasFax(): return None info_dict = {} cmdresp = self.executeComma...
[ "def", "getFaxStatsCounters", "(", "self", ")", ":", "if", "not", "self", ".", "hasFax", "(", ")", ":", "return", "None", "info_dict", "=", "{", "}", "cmdresp", "=", "self", ".", "executeCommand", "(", "'fax show stats'", ")", "ctxt", "=", "'general'", "...
Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show stats @return: Dictionary of fax stats.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Fax", "Stats", ".", "CLI", "Command", "-", "fax", "show", "stats" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L753-L777
aouyar/PyMunin
pysysinfo/asterisk.py
AsteriskInfo.getFaxStatsSessions
def getFaxStatsSessions(self): """Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show sessions @return: Dictionary of fax stats. """ if not self.hasFax(): return None info_dict = {} info_dict['total'] = 0 ...
python
def getFaxStatsSessions(self): """Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show sessions @return: Dictionary of fax stats. """ if not self.hasFax(): return None info_dict = {} info_dict['total'] = 0 ...
[ "def", "getFaxStatsSessions", "(", "self", ")", ":", "if", "not", "self", ".", "hasFax", "(", ")", ":", "return", "None", "info_dict", "=", "{", "}", "info_dict", "[", "'total'", "]", "=", "0", "fax_types", "=", "(", "'g.711'", ",", "'t.38'", ")", "f...
Query Asterisk Manager Interface for Fax Stats. CLI Command - fax show sessions @return: Dictionary of fax stats.
[ "Query", "Asterisk", "Manager", "Interface", "for", "Fax", "Stats", ".", "CLI", "Command", "-", "fax", "show", "sessions" ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/asterisk.py#L779-L813
aouyar/PyMunin
pymunin/plugins/wanpipestats.py
MuninWanpipePlugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" for iface in self._ifaceList: if self._reqIfaceList is None or iface in self._reqIfaceList: if (self.graphEnabled('wanpipe_traffic') or self.graphEnabled('wanpipe_errors')): sta...
python
def retrieveVals(self): """Retrieve values for graphs.""" for iface in self._ifaceList: if self._reqIfaceList is None or iface in self._reqIfaceList: if (self.graphEnabled('wanpipe_traffic') or self.graphEnabled('wanpipe_errors')): sta...
[ "def", "retrieveVals", "(", "self", ")", ":", "for", "iface", "in", "self", ".", "_ifaceList", ":", "if", "self", ".", "_reqIfaceList", "is", "None", "or", "iface", "in", "self", ".", "_reqIfaceList", ":", "if", "(", "self", ".", "graphEnabled", "(", "...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/wanpipestats.py#L156-L191
ContextLab/quail
quail/simulate.py
simulate_list
def simulate_list(nwords=16, nrec=10, ncats=4): """A function to simulate a list""" # load wordpool wp = pd.read_csv('data/cut_wordpool.csv') # get one list wp = wp[wp['GROUP']==np.random.choice(list(range(16)), 1)[0]].sample(16) wp['COLOR'] = [[int(np.random.rand() * 255) for i in range(3)] ...
python
def simulate_list(nwords=16, nrec=10, ncats=4): """A function to simulate a list""" # load wordpool wp = pd.read_csv('data/cut_wordpool.csv') # get one list wp = wp[wp['GROUP']==np.random.choice(list(range(16)), 1)[0]].sample(16) wp['COLOR'] = [[int(np.random.rand() * 255) for i in range(3)] ...
[ "def", "simulate_list", "(", "nwords", "=", "16", ",", "nrec", "=", "10", ",", "ncats", "=", "4", ")", ":", "# load wordpool", "wp", "=", "pd", ".", "read_csv", "(", "'data/cut_wordpool.csv'", ")", "# get one list", "wp", "=", "wp", "[", "wp", "[", "'G...
A function to simulate a list
[ "A", "function", "to", "simulate", "a", "list" ]
train
https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/simulate.py#L5-L14
aouyar/PyMunin
pymunin/plugins/mysqlstats.py
MuninMySQLplugin.retrieveVals
def retrieveVals(self): """Retrieve values for graphs.""" if self._genStats is None: self._genStats = self._dbconn.getStats() if self._genVars is None: self._genVars = self._dbconn.getParams() if self.hasGraph('mysql_connections'): self.setGraphVal('my...
python
def retrieveVals(self): """Retrieve values for graphs.""" if self._genStats is None: self._genStats = self._dbconn.getStats() if self._genVars is None: self._genVars = self._dbconn.getParams() if self.hasGraph('mysql_connections'): self.setGraphVal('my...
[ "def", "retrieveVals", "(", "self", ")", ":", "if", "self", ".", "_genStats", "is", "None", ":", "self", ".", "_genStats", "=", "self", ".", "_dbconn", ".", "getStats", "(", ")", "if", "self", ".", "_genVars", "is", "None", ":", "self", ".", "_genVar...
Retrieve values for graphs.
[ "Retrieve", "values", "for", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/mysqlstats.py#L451-L610
aouyar/PyMunin
pymunin/plugins/mysqlstats.py
MuninMySQLplugin.engineIncluded
def engineIncluded(self, name): """Utility method to check if a storage engine is included in graphs. @param name: Name of storage engine. @return: Returns True if included in graphs, False otherwise. """ if self._engines is None: self._engin...
python
def engineIncluded(self, name): """Utility method to check if a storage engine is included in graphs. @param name: Name of storage engine. @return: Returns True if included in graphs, False otherwise. """ if self._engines is None: self._engin...
[ "def", "engineIncluded", "(", "self", ",", "name", ")", ":", "if", "self", ".", "_engines", "is", "None", ":", "self", ".", "_engines", "=", "self", ".", "_dbconn", ".", "getStorageEngines", "(", ")", "return", "self", ".", "envCheckFilter", "(", "'engin...
Utility method to check if a storage engine is included in graphs. @param name: Name of storage engine. @return: Returns True if included in graphs, False otherwise.
[ "Utility", "method", "to", "check", "if", "a", "storage", "engine", "is", "included", "in", "graphs", "." ]
train
https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/mysqlstats.py#L612-L621